import axios from "axios"
import flinksUrls from "../../../urls/corporate/flink/flink"

export default {
  // 获取所有合作链接
  fetchGetFriendLinksByPage (params) {
    return axios.post(flinksUrls.getFriendLinksByPage, params)
  },
  // 上传图片
  fetchUploadImage (imageData) {
    return axios.post(flinksUrls.uploadImage, imageData, { headers: { "Content-Type": "multipart/form-data" } })
  },
  // 校验广告名称是否唯一
  fetchCheckFlink (flname) {
    return axios.post(flinksUrls.checkFlinks + "?flname=" + flname)
  },
  // 添加新的连接
  fetchAddFlink (params) {
    return axios.post(flinksUrls.addFlinks, params)
  },
  // 删除链接
  fetchDeleteFlink (flid) {
    return axios.post(flinksUrls.deleteFlinks + "?flid=" + flid)
  },
  // 删除链接
  fetchBatchDeleteFlinks (params) {
    return axios.post(flinksUrls.batchDeleteFlinks, params)
  }
}
